package es.dk.hl.model
{
	
	import com.adobe.cairngorm.model.ModelLocator;
	import com.facebook.Facebook;
	import com.facebook.data.users.FacebookUser;
	import com.facebook.utils.FacebookSessionUtil;
	
	import es.dk.hl.business.Services;
	import es.dk.hl.control.Controller;
	
	import flash.display.LoaderInfo;
	import flash.utils.Dictionary;
	
	import mx.collections.XMLListCollection;
	
	public class HomeLinkModelLocator implements   ModelLocator{
		
		private static var modelLocator : HomeLinkModelLocator;
		  
		public static function getInstance() : HomeLinkModelLocator {
		  	
		  	if ( modelLocator == null ) {
		  		modelLocator = new HomeLinkModelLocator();
		  	}
		  	return modelLocator;
		}
			
		public function HomeLinkModelLocator() {
			if ( modelLocator != null ){
				throw new Error( "Only one CmosModelLocator instance should be instantiated" );	
			}		
		}
		
	    public var workflowState:Number = VIEW_MAIN;
	    public static const VIEW_MAIN : Number = 0;
	   	public static const VIEW_DIALOGMAIN : Number = 1;
	   	
	    public var appState:Number = SERVICES_OFF;
	    public static const SERVICES_OFF : Number = 0;
	   	public static const SERVICES_ON	 : Number = 1;
	   		   	
		public var services:Services = new Services();
		public var control:Controller = new Controller();		   	
	   	
	   	public var dicIWallHelpers:Dictionary = new Dictionary(); 
	   	
		[Bindable] public var photoXLC:XMLListCollection;
		
		public var loaderInfoToFacebook:LoaderInfo;
		public var facebook:Facebook;
		public var facebookSessionUtil:FacebookSessionUtil;
		public var facebookUser:FacebookUser;		
		
		[Bindable] public var nameUser:String = "";
		[Bindable] public var tip:String = "";
		
		public var composicion:String = "";
		public var composicion_id:Number = -1;
		
		[Bindable] private var _statusFaceBookConnect:Number = statusFaceBookConnect_LOGIN;
		
		public static const statusFaceBookConnect_LOGIN : Number = 0;
		public static const statusFaceBookConnect_CONNECT : Number = 1;
		public static const statusFaceBookConnect_CONNECTED : Number = 2;
		public static const statusFaceBookConnect_LOGOUT : Number = 3;
		public static const statusFaceBookConnect_DISCONNECTED : Number = 4; 

		public function get statusFaceBookConnect():Number
		{
			return _statusFaceBookConnect;
		}
		
		public function set statusFaceBookConnect(value:Number):void
		{
			_statusFaceBookConnect = value;
		}
	}
}